#include "webthumbnail.h"

WebThumbnail::WebThumbnail(QString url)
{
    view = new QWebView(0);
    connect(view,SIGNAL(loadFinished(bool)),this,SLOT(finish(bool)));
    connect(view,SIGNAL(loadFinished(bool)),this,SIGNAL(snapdone(bool)));
    view->load(QUrl(url));
    view->setGeometry(-2000,-2000,800,600);
    view->show();
}

void
WebThumbnail::finish(bool done)
{
    snap = QPixmap::grabWindow(view->winId());
    view->close();
}
